home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F27170_EmployeesToText.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.6 KB  |  43 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       XSLT
  4.   Sub-category:   xsl:output
  5.   Author:         David Silverlight
  6.                   HeadGeek@xmlpitstop.com
  7.   Created:        2001-05-16
  8.   Description:-
  9.     This stylesheet processes a set of XML elements and creates
  10.     a resulting text file.  This is accomplished using the
  11.     output method of Text as shown above.  In this example,
  12.     we are taking the original xml elements and creating
  13.     delimited text document sorted by name.
  14.  =============================================================== -->
  15. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  16.  
  17. <!-- Note: The following XSLT method is required to specify the output type of Text -->
  18. <xsl:output method="text"/>
  19.  
  20.  
  21.  
  22. <!-- Template for root rule -->
  23. <xsl:template match="/">
  24.     <xsl:apply-templates/>
  25. </xsl:template>
  26.  
  27.  
  28. <!-- Template for "employees" elements -->
  29. <xsl:template match="employees">
  30.     <!--This stylesheet processes a set of XML elements and 
  31.     creates a resulting text file.  This is accomplished using the output method of Text as
  32.     shown above.  In this example, we are taking the original xml elements and 
  33.     creating delimited text document sorted by name-->
  34. <xsl:for-each select="employee" >
  35.     <xsl:sort select="employeename" order="ascending" />
  36.     <xsl:value-of select="department" />;<xsl:value-of select="employeename" />;<xsl:value-of select="hourlyrate" />;<xsl:value-of select="primarylanguage" />|
  37. </xsl:for-each>
  38.  
  39. </xsl:template>
  40.  
  41.  
  42.  
  43. </xsl:stylesheet>